<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title></title>
    <script src="js/mui.min.js"></script>
    <link href="css/mui.min.css" rel="stylesheet"/>
    <link rel="stylesheet" type="text/css" href="css/mui.min.css"/>
    <link rel="stylesheet" type="text/css" href="css/style.css"/>
</head>
	<body>
		<header class="mui-bar mui-bar-nav">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		    <h1 class="mui-title">我的</h1>
		</header>
		<div class="mui-content">    
		    <div class="my_av"> 
		    	<div class="avt">
		    		<p id="name">我的用户名</p> 
		    	</div>
		    </div>
		</div>   
		<div>
		    <ul class="mainList">   
		    	<li>
		    		<img src="img/my-ziliao.png"/ class="" class="my-icon">
		    		<p>我的资料</p> 
		    		<span class="mui-icon mui-icon-arrowright icLe"></span>
		    	</li>
		    	<li>
		    		<img src=""/>
		    		<p>我的关注</p>
		    		<span class="mui-icon mui-icon-arrowright icLe"></span>
		    	</li>
		    	<li>
		    		<img src="" alt="" />
		    		<p>客服中心</p>
		    		<span class="mui-icon mui-icon-arrowright icLe"></span>
		    	</li>
		    	<li>
		    		<img src="" alt="" />
		    		<p>关于软件</p>
		    		<span class="mui-icon mui-icon-arrowright icLe"></span>
		    	</li>
		    </ul>            
		    <button type="button" id="goOut" class="mui-btn mui-btn-blue mui-btn-block main_button">退出登陆</button>
		</div>
		<script src="js/mui.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/index.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			mui.plusReady(function(){
				var app =  document.getElementById("login");
				var goOut = document.getElementById('goOut');
				var name = document.getElementById('name');
				app.addEventListener("tap",function(){
					  var Token = localStorage.getItem('token');
					mui.ajax({
					type:"get",
					url:"http://www.zhangjianxiong.club:5000/api/users/current",
					dataType:'json',
					headers:{
						'Content-Type':'application/x-www-form-urlencoded',
						'Authorization':Token
					},
					success:function(data){
						name.innerHTML = data.name;
						if(goOut.tap){
							Token = '';
							mui.openWindow({
							url:"index.html",
								id:"index"
							})
						}
					}
					})
				})
			});
		</script>
	</body>
</html> 
